package com.jbit.controller;

import com.jbit.dto.DmItemType;
import com.jbit.service.DmItemTypeService;
import com.jbit.utils.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/item/api/p/type")
public class TypeController {
    @Resource
    private DmItemTypeService dmItemTypeService;

    @PostMapping("/queryItemType")
    public ResponseEntity queryItemType(@RequestBody DmItemType dmItemType) {
        return ResponseEntity.sendSuccess(dmItemTypeService.queryItemType(dmItemType.getParent()));
    }
}
